/**
 * @function
 * @author zhulizhe
 * @date 2020-09-05 19:53
 */

import React, { useState } from "react";
import {Button, DrawerLayoutAndroid, Text, StyleSheet, View, AppRegistry} from 'react-native';
import {name as appName} from './app.json';
import Video from 'react-native-video';
const default_url = 'http://qnimage.xiteng.com/2020-08-01%20015457.mov';
const video_cover = `${default_url}?vframe/jpg/offset/0`;

const App = () => {
    const [drawerPosition, setDrawerPosition] = useState("left");
    const changeDrawerPosition = () => {
        if (drawerPosition === "left") {
            setDrawerPosition("right");
        } else {
            setDrawerPosition("left");
        }
    };

    const navigationView = (
        <View style={styles.navigationContainer}>
            <Text style={{ margin: 10, fontSize: 15 }}>I'm in the Drawer!</Text>
        </View>
    );

    return (
        <Video source={{uri: default_url}}   // Can be a URL or a local file.
               poster={video_cover}
               resizeMode={'contain'}
               controls={true}
               style={styles.backgroundVideo} />
    );
};

const styles = StyleSheet.create({
    backgroundVideo: {
        position: 'absolute',
        top: 0,
        left: 0,
        bottom: 0,
        right: 0,
    },
});

AppRegistry.registerComponent(appName, () => App);
